//
// Created by vista on 2017/12/11.
//

#ifndef P_P12_H
#define P_P12_H

#include <vector>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <iostream>
#include <stack>
using namespace std;

class Solution {
public:


/*  cout << solution.intToRoman(1) << endl;
    cout << solution.intToRoman(9) << endl;
    cout << solution.intToRoman(10) << endl;
    cout << solution.intToRoman(99) << endl;
    cout << solution.intToRoman(100) << endl;
    cout << solution.intToRoman(999) << endl;
    cout << solution.intToRoman(3999) << endl;

    I
    IX
    X
    XCIX
    C
    CMXCIX
    MMMCMXCIX
    */

    string intToRoman(int num) {
        string romanPieces[] = {"","I","II","III","IV","V","VI","VII","VIII","IX",
                                "","X","XX","XXX","XL","L","LX","LXX","LXXX","XC",
                                "","C","CC","CCC","CD","D","DC","DCC","DCCC","CM",
                                "","M","MM","MMM","MMMM"};
        return romanPieces[num/1000+30] + romanPieces[(num%1000)/100+20] + romanPieces[(num%100)/10+10] + romanPieces[num%10];
    }
};

#endif //P_P12_H
